package com.code.demo.mvp.view;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.code.demo.R;
import com.code.demo.mvp.base.BaseMvpFragment;
import com.code.demo.mvp.contract.FakeContract;
import com.code.demo.mvp.presenter.FakePresenter;

import butterknife.BindView;

/**
 * Created by yangliguo on 2019/3/1.
 */

public class FakeFragment extends BaseMvpFragment<FakePresenter> implements FakeContract.FakeView {

    @BindView(R.id.fake)
    TextView fake;

    @Override
    public int getLayoutResId() {
        return R.layout.fragment_fake;
    }

    @Override
    public FakePresenter createPresenter() {
        return new FakePresenter();
    }

    @Override
    public void finishCreateView(Bundle savedInstanceState) {
        fake.setText("Fragment Fragment");

        Log.e("fake", "FakeFragment");
        Log.e("fake", android.os.Process.myTid()+"");
        presenter.getUsers();
    }

    @Override
    public void showLoading() {
        fake.setText("loading");
    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showUsers(String users) {
        fake.setText(users);
    }

    @Override
    public void showTodo(String todo) {

    }
}
